Copyright(C) 1994 Terumasa KODAKA , Takeshi KONO
■FD BIOS
Overview of FD BIOS
               o FD BIOS is a BIOS that accesses FDs other than 320KB FDs.
                 In FD BIOS, the lower 4 bits of AH specify the operation, and the upper 4 bits specify the functions
                 associated with that operation. For this reason, in FD BIOS, the values are arranged in ascending order based on the value of the lower 4 bits.
Terminology      Dual-use BIOS
               o This refers to the BIOS that controls dual-use floppy disks that support both 1MB and 640KB formats.
                 The 1.44MB dual-use BIOS, which controls a 3-mode floppy disk that also supports the 1.44MB format, is upwardly compatible with the dual-use BIOS.
               o Dual-use BIOS has a 1MB I/F mode and a 640KB I/F mode. The supported modes differ depending on the model.
                 - Normal mode: 1MB I/F mode and 640KB I/F mode
                 - High-resolution mode: 1MB I/F mode only
                 - PC-98LT・HA: 640KB I/F mode only
               o The processing routine is in the main BIOS for all models.
Terminology      1MB dedicated BIOS
               o Provided by the BIOS ROM mounted on the PC-9801-15 (8-inch standard floppy disk interface board).
                 The PC-9801M2 has a built-in ROM compatible with the PC-9801-15.
               o The 1MB floppy disk interface built into the first generation PC-9801 is also a 1MB dedicated BIOS.
                 The processing routine is in the main BIOS (segment FD80h).
               o When a 1MB FDD is connected to a model with an optional built-in FDD, such as the PC-9801VM0, VX0, or VX01,
                 via the 1MB floppy disk interface connector on the main unit, only 1MB format disks can be handled, but the FD BIOS is a dual-purpose BIOS.
Terminology      640KB dedicated BIOS
               o Provided by the BIOS ROM installed on the PC-9801-08/09 (mini floppy disk interface board). The PC-9801F2 has a built-in ROM compatible with the PC-9801-09.
               o The PC-9801U/VF is a 640KB dedicated machine, but since the installed ROM is the same as the PC-9801VM2, it is a dual-purpose BIOS (fixed to 640KB I/F mode).
Terminology      I/F mode
               o Dual-purpose BIOS has two types of I/F modes: 1MB I/F mode and 640KB I/F mode. The I/F mode is fixed to one of them when the system starts up.
               o The I/F mode is determined by the state of DIP SW 3-1, 3-2 and the boot device (media).・The 1MB I/F mode is set in the following cases:
                 - DIP SW 3-1=ON, 3-2=OFF
                 - DIP SW 3-1=OFF,3-2=OFF, booted from a device other than a floppy disk
                 - DIP SW 3-1=OFF, booted from a 1MB/1.44MB format disk
                   (DIP SW 3-2 setting is optional)
               ・The 640KB I/F mode is set in the following cases:
                 - DIP SW 3-1=ON, 3-2=ON
                 - DIP SW 3-1=OFF,3-2=ON, booted from a device other than a floppy disk
                 - DIP SW 3-1=OFF, booted from a 640KB format disk
                   (DIP SW 3-2 setting is optional)
               o The 1MB I/F mode mainly uses the same hardware resources as the 1MB dedicated BIOS (FDC I/O address, hardware interrupts, DMA channels, system common area, etc.).
                 The 640KB I/F mode mainly uses the same hardware resources as the 640KB-only BIOS.
                 In read/write processing, an error will occur because the data cannot be read or written normally.
Terminology      DA/UA
               o DISK BIOS uses a value called DA/UA (Device Address/Unit Address) to specify the name of the device to be accessed.
                 The upper 4 bits of DA specify the type of device. The lower 4 bits of UA specify the number of the drive among
                 devices of the same type. For example, to specify the first FDD connected to a 1MB dedicated I/F, use DA/UA=90h, and to specify the fourth, use DA/UA=93h.
Table            DA/UA for Dedicated BIOS
                 +---------------------+-------------+
                 | 1MB Dedicated I/F   |     9nh     |
                 | 640KB Dedicated I/F |     7nh     |
                 +---------------------+-------------+
                 * n=device number (0-3)
               o Dual-use BIOS can handle multiple formats on one drive, but the same drive is assigned a DA value for each
                 access mode (see table: "Dual-use BIOS I/F Mode/Access Mode and DA/UA Correspondence").
                 For example, in 1MB I/F mode, to access a 1MB format disk on the first FDD, specify DA/UA=90h. To access a 640KB format disk,
                 specify DA/UA=10h, and to access a 1.44MB format disk, specify DA/UA=30h.
Table            Dual-use BIOS I/F mode/access mode and DA/UA compatibility
                 +------------------+------------+--------------+---------------+
                 |\ Access mode    | 1MB access | 640KB access | 1.44MB access |
                 | Interface mode \|       mode |        mode  |          mode |
                 +------------------+------------+--------------+---------------+
                 |     1MB I/F mode |    9nh     |      1nh     |      3nh      |
                 |   640KB I/F mode |    Fnh     |      7nh     | Not possible  |
                 +------------------+------------+--------------+---------------+
                 * n=Device number (0-3)
               o For reference, a list of DA/UAs is shown in the table "All DA/UAs and device compatibility list".
Table            List of all DA/UA and device compatibility
                 --------+---------------------------------------------------------------
                 DA/UA   | Device
                 --------+---------------------------------------------------------------
                 00-03h  | SASI/ESDI/IDE HD BIOS (linear sector addressing)
                 10-13h  | Dual-use BIOS - 1MB I/F mode + 640KB access mode
                 20-26h  | SCSI HD BIOS (linear sector addressing)
                 30-33h  | Dual-use BIOS - 1MB I/F mode + 1.44MB access mode
                 40h     | For initializing RAM drive BIOS
                 50-53h  | 320KB FD BIOS
                 60-63h  | BRANCH 4670 virtual disk
                 70-73h  | 640KB dedicated BIOS, dual-use BIOS - 640KB I/F mode + 640KB access mode
                 80-83h  | SASI/ESDI/IDE HD BIOS (absolute sector addressing)
                 90-93h  | 1MB dedicated BIOS, dual-use BIOS - 1MB I/F mode + 1MB access mode
                 A0-A6h  | SCSI HD BIOS (absolute sector addressing)
                 B0-B3h  | Dual-use BIOS - 1MB I/F mode + 1.44MB access mode (Undocumented)
                 C0-C7h  | SCSI BIOS
                 D0h     | ROM drive (cannot be accessed with DISK BIOS)
                 D1h     | PCMCIA memory card (cannot be accessed with DISK BIOS)
                 E0h     | RAMDISK.SYS
                 F0-F3h  | Dual-use BIOS - 640KB I/F mode + 1MB access mode
                 --------+---------------------------------------------------------------
Terminology      RAM drive
               o FDD-compatible RAM disk installed in 98NOTE (except PC-9801NL/R), PC-9801UR, and PC-98HA.
                 It hooks INT 1Bh and emulates an FD BIOS. From the software's perspective, it appears to be one of the built-in dual-purpose drives.
                 The processing routine is in the expansion ROM in segment D800h.
               o It operates almost identically to the dual-purpose BIOS. It supports 1MB I/F mode and 640KB I/F mode.
               o Among the 98NOTE dual-purpose BIOS machines that support 1.44MB, there are models whose RAM drive supports the
                 1.44MB format and models whose RAM drive supports only up to the 1MB format.
                 The PC-9821Ne supports 1.44MB, while the PC-9801NS/R・P・NX/C・NS/A do not support 1.44MB.
Terminology      1MB/640KB/1.44MB format
               o 1MB format refers to a disk formatted to an unformatted capacity of 1.6MB on 3.5"2HD, 5"2HD, or 8"2D media.
                 When formatted with MS-DOS to 8 sectors/track, the formatted capacity is approximately 1.2MB.
               o 640KB format refers to a disk formatted to an unformatted capacity of 1.0MB on 3.5"2DD or 5"2DD media.
                 When formatted with MS-DOS to 9 sectors/track, the formatted capacity is approximately 720KB.
               o 1.44MB format refers to a disk formatted to an unformatted capacity of 2.0MB on 3.5"2HD media.
                 When formatted with MS-DOS to 18 sectors/track, the formatted capacity is approximately 1.44MB.
INT 1Bh - Function x0h,x8h,xBh,xFh(FD)
Classification   DISK BIOS
Name             Non-operational
Target           Dual-use BIOS, 1MB-only BIOS, 640KB-only BIOS
Input            AH=x0h,x8h,xBh,xFh
                 AL=DA/UA
                 ---------------------------------------+-----------
                 Access condition                       | DA/UA value
                 ---------------------------------------+-----------
                 Dual-use BIOS 1MB I/F mode             | 9nh,1nh,3nh
                 Dual-use BIOS 640KB I/F mode           | 7nh,Fnh
                 1MB-only BIOS                          | 9nh
                 640KB-only BIOS                        | 7nh
                 ---------------------------------------+-----------
                 * n=Device number (0-3)
Output           AH=Return code (bits 3-0 are undefined)
                 ----------+------------------------------------------
                 AH        | Contents
                 ----------+------------------------------------------
                 00h(CF=0) | Normal End
                           | Normal end
                 40h(CF=1) | Equipment Check
                           | DA specified a value that the BIOS does not support
                 ----------+------------------------------------------
Explanation    o If 0h, 8h, Bh, or Fh is specified in AH bits 3 to 0, the FD BIOS will not perform any processing other than returning a return code.
                 However, if AH bit 4=1, only head seek will be performed.
Related          INT 1Bh - Function 10h(FD)
INT 1Bh - Function 10h(FD)
Classification   DISK BIOS
Name             Head movement (seek)
Target           Dual-use BIOS, 1MB dedicated BIOS, 640KB dedicated BIOS
Input            AH=x/x/x/1/x/x/x/x b
                 AL=DA/UA
                 ---------------------------------------+-----------
                 Access condition                       | DA/UA value
                 ---------------------------------------+-----------
                 Dual-use BIOS 1MB I/F mode             | 9nh,1nh,3nh
                 Dual-use BIOS 640KB I/F mode           | 7nh,Fnh
                 1MB dedicated BIOS                     | 9nh
                 640KB dedicated BIOS                   | 7nh
                 ---------------------------------------+-----------
                 * n=Device number (0-3)
                 CL=Cylinder number
                 -----------------+------------------
                 Drive type       | Cylinder number range
                 -----------------+------------------
                 3.5 inch, 5 inch | 0-79d
                 8 inch           | 0-76d
                 -----------------+------------------
Output           AH=Return code (bits 3-0 are undefined)
                 ----------+------------------------------------------
                 AH        | Contents
                 ----------+------------------------------------------
                 00h(CF=0) | Normal End
                           | Normal end
                 40h(CF=1) | Equipment Check
                           | DA specified a value that the BIOS does not support
                 6xh(CF=1) | Not Ready
                           | No disk is set or drive is not connected
                 ----------+------------------------------------------
Explanation    o Moves the head to the specified cylinder.
               u There is no function that only performs seeks.
                 In the FD BIOS, when AH bit 4 (SEEK bit) is 1 for all functions, the head is moved (seeked).
                 This is done before processing the function specified by the lower 4 bits. This also applies to
                 INT 1Bh - Function n4h (sense commands) and INT 1Bh - Function n3h (initialization commands).
                u The BIOS will also terminate normally if you attempt to seek beyond the cylinder number supported by the drive.
Related
INT 1Bh - Function 01h (FD)
Classification   DISK BIOS
Name             Verify (VERIFY)
Target           Dual-use BIOS, 1MB-only BIOS, 640KB-only BIOS
Input            AH
                   bit 7=MT
                     1=Multi-track
                     0=Single-track
                   bit 6=MF
                     1=Double density (MFM)
                     0=Single density (FM)
                   bit 5=r
                     1=No retry
                     0=8 retries
                   bit 4=SEEK
                     1=Seek operation
                     0=Access current track position
                   bit 3-0=0001b
                 AL=DA/UA
                   -------------------------------------------+----------
                   Access condition                           | DA/UA value (n=device number 0-3)
                   -------------------------------------------+----------
                   Dual-use BIOS 1MB I/F mode, 1MB access     | 9nh
                   Dual-use BIOS 1MB I/F mode, 640KB access   | 1nh
                   Dual-use BIOS 1MB I/F mode, 1.44MB access  | 3nh
                   Dual-use BIOS 640KB I/F mode, 640KB access | 7nh
                   Dual-use BIOS 640KB I/F mode, 1MB access   | Fnh
                   1MB-only BIOS                              | 9nh
                   640KB-only BIOS                            | 7nh
                   -------------------------------------------+----------
                 BX=Number of bytes transferred
                 CH=Sector length
                   00h= 128 bytes/sector
                   01h= 256 bytes/sector
                   02h= 512 bytes/sector
                   03h=1024 bytes/sector
                 CL=Cylinder number (only when SEEK bit = 1)
                   -----------------+------------------
                   Drive type       | Range of cylinder number
                   -----------------+------------------
                   3.5 inch, 5 inch | 0-79d
                   8 inch           | 0-76d
                   -----------------+------------------
                 DH=head number
                   -------------------------------------+----------------
                   Media/mode type                      | head number range
                   -------------------------------------+----------------
                   Double-sided media/double-sided mode | 0-1
                   Single-sided media/single-sided mode | 0
                   -------------------------------------+----------------
                   * Single-sided media is only available in 8-inch size, and single-sided mode is only available in 640KB access mode.
                 DL=sector number
                   (1 to maximum value depends on the format)
                 ES:BP=transfer address
Output           AH=return code (bits 3 to 0 are undefined)
                   ----------+------------------------------------------
                   AH        | Contents
                   ----------+------------------------------------------
                   00h(CF=0) | Normal End
                             | Normal end
                   2xh(CF=1) | DMA Boundary
                             | Transfer area crosses 64KB boundary
                   3xh(CF=1) | End Of Cylinder
                             | Transfer attempt across cylinder
                   40h(CF=1) | Equipment Check
                             | DA value specified for which BIOS does not support
                   5xh(CF=1) | Over Run
                             | Data transfer did not finish within a certain time
                   6xh(CF=1) | Not Ready
                             | Disk not inserted or drive not connected
                   Axh(CF=1) | Data Error
                             | CRC error occurred
                   Cxh(CF=1) | No Data
                             | Specified sector not found
                   Exh(CF=1) | Missing Address Mark
                             | ID address mark not found
                   ----------+-----------------------------------------
Explanation    o Reads the specified sector and returns a return code.
                 Unlike INT 1Bh - Function 06h(FD), it does not stop processing even if it detects DDAM(Deleted Data Address Mark). It skips the sector and continues verifying.
               u No transfer to memory is performed, but input parameters are checked in the same way as INT 1Bh - Function 06h(FD), so an error occurs if the following conditions are not met.
               o When MT=0(single track specified), BX(number of transfer bytes) must be set so that one read is completed within the same track on one side of the disk.
                 When MT=1(multi-track specified), BX(number of transfer bytes) must be set so that one read is completed within the same cylinder on both sides of the disk.
                 Reads across cylinders are not possible.
               o ES:BP (transfer address) and BX (number of bytes transferred) must be set so that the specified area does not cross the
                 64K byte boundary of the physical address. For example, an area such as ES:BP=7000:FF00h, BX=0400h cannot be specified.
               o The value specified for BX (number of bytes transferred) does not need to be an integer multiple of the sector length.
Related          INT 1Bh - Function 02h(FD)
                 INT 1Bh - Function 06h(FD)
                 INT 1Bh - Function 0Ch(FD)
INT 1Bh - Function 02h (FD)
Classification   DISK BIOS
Name             Read for diagnosis (READ DIAGNOSTIC)
Target           Dual-use BIOS, 1MB dedicated BIOS
Input            AH bit 7=0
                   bit 6=MF
                     1=Double density (MFM)
                     0=Single density (FM)
                   bit 5=r
                     1=No retry
                     0=8 retry attempts
                   bit 4=SEEK
                     1=Perform seek
                     0=Access current track position
                   bit 3-0=0010b
                 AL=DA/UA
                   -------------------------------------------+----------
                   Access condition                           | DA/UA value (n=device number 0-3)
                   -------------------------------------------+----------
                   Dual-use BIOS 1MB I/F mode, 1MB access     | 9nh
                   Dual-use BIOS 1MB I/F mode, 640KB access   | 1nh
                   Dual-use BIOS 1MB I/F mode ,1.44MB access  | 3nh
                   Dual-use BIOS 640KB I/F mode, 640KB access | 7nh
                   Dual-use BIOS 640KB I/F mode, 1MB access   | Fnh
                   1MB dedicated BIOS                         | 9nh
                   -------------------------------------------+----------
                 BX=Number of transfer bytes
                 CH=Sector length
                   00h= 128 bytes/sector
                   01h= 256 bytes/sector
                   02h= 512 bytes/sector
                   03h=1024 bytes/sector
                 CL=Cylinder number (only when SEEK bit = 1)
                   -----------------+------------------
                   Drive type       | Cylinder number range
                   -----------------+------------------
                   3.5 inch, 5 inch | 0-79d
                   8 inch           | 0-76d
                   -----------------+------------------
                 DH=Head number
                   -------------------------------------+----------------
                   Media/mode type                      | Head number range
                   -------------------------------------+----------------
                   Double-sided media/double-sided mode | 0-1
                   Single-sided media/single-sided mode | 0
                   -------------------------------------+----------------
                   * Single-sided media is only available in 8-inch, and single-sided mode is only available in 640KB access mode.
                 ES:BP=Buffer address
Output           AH=Return code (bits 3 to 0 are undefined)
                   ----------+------------------------------------------
                   AH        | Contents
                   ----------+------------------------------------------
                   00h(CF=0) | Normal End
                             | Normal end
                   1xh(CF=0) | Control Mark
                             | DDAM (Deleted Data Address Mark) was detected
                   2xh(CF=1) | DMA Boundary
                             | Transfer area crosses 64KB boundary
                   3xh(CF=1) | End Of Cylinder
                             | Transfer across cylinders was attempted
                   40h(CF=1) | Equipment Check
                             | DA value specified for which BIOS does not support
                   5xh(CF=1) | Over Run
                             | Data transfer did not finish within a certain period of time
                   6xh(CF=1) | Not Ready
                             | Disk not inserted or drive not connected
                   Axh(CF=1) | Data Error
                             | CRC error occurred
                   Cxh(CF=1) | No Data
                             | Correct ID not found even after reading one track
                   Exh(CF=1) | Missing Address Mark
                             | ID address mark not found
                   ----------+------------------------------------------
Explanation    o Reads data from sector number 1 of the specified track.
                 INT 1Bh - Unlike Function 06h, reading starts immediately after the index mark. Even if an ID error, a CRC error in the data section,
                 or DDAM is detected, reading continues for the size specified by BX (number of transfer bytes).
               u The technical data book states that a sector number can be specified in DL, but in reality, transfer starts from the first sector of
                 the specified track regardless of the value of DL.
               o When MT=0 (single track specified), BX (number of transfer bytes) must be set so that one transfer is completed within the same track on one side of the disk.
                 When MT=1 (multi-track specified), BX (number of transfer bytes) must be set so that one transfer is completed within the same cylinder on both sides of the disk.
                 Transfers across cylinders cannot be performed.
               o ES:BP (transfer address) and BX (number of bytes to transfer) must be set so that the transfer area does not cross the 64K byte
                 boundary of the physical address. For example, it is not possible to transfer to an area such as ES:BP=7000:FF00h, BX=0400h.
               o The value specified for BX (number of bytes to transfer) does not need to be an integer multiple of the sector length.
                 Data of the same length as the specified value is actually transferred.
Related          INT 1Bh - Function 01h(FD)
                 INT 1Bh - Function 06h(FD)
                 INT 1Bh - Function 0Ch(FD)
INT 1Bh - Function 03h (FD)
Category:        Disk BIOS
Name:            Initialization (INITIALIZE)
Target:          Dual-use BIOS, 1MB-only BIOS, 640KB-only BIOS
Input:           AH=03h
                 AL=DA/UA
                 ---------------------------------------+--------------------
                 Access Condition:                      | DA/UA Value (x=any)
                 ---------------------------------------+--------------------
                 Dual-use BIOS: 1MB I/F Mode            | 9xh, 1xh, 3xh
                 Dual-use BIOS: 640KB I/F Mode          | 7xh, Fxh
                 1MB-only BIOS                          | 9xh
                 640KB-only BIOS                        | 7xh
                 ---------------------------------------+-----------
Output:          AH=Return Code (bits 3-0 are undefined)
                 ----------------+------------------------------------------
                 AH              | Content
                 ----------------+------------------------------------------
                 00h (CF=0)      | Normal End
                                 | Normal End
                 40h (CF=1)      | Equipment Check
                                 | A value was specified for DA that does not support a BIOS.
                 ----------------+------------------------------------------
Description    o Initializes the FD BIOS.
                 It is already initialized at system startup.
Related          0000:0564h
                 0000:05CAh
                 INT 1Bh - Function 83h (FD)
INT 1Bh - Function 83h (FD)
Category         DISK BIOS
Name             Motor Stop Mode Setting
Target           Dual-Use BIOS - 1MB I/F Mode
Excluding        PC-9801VM2, VM21, UV2, UV21, VX2, VX21, UX, and PC-XA and XL
Input            AH=83h
                 AL=DA/UA
                 ---------------------------------------+-----------
                 Access Condition                       | DA/UA Value (x=any)
                 ---------------------------------------+-----------
                 Dual-Use BIOS 1MB I/F Mode             | 9xh, 1xh, 3xh
                 ---------------------------------------+-----------
Output           AH=Return Code (bits 3-0 are undefined)
                 ---------------+------------------------------------------
                 AH             | Contents
                 ---------------+------------------------------------------
                 00h (CF=0)     | Normal End
                                | Normal End
                 40h (CF=1)     | Equipment Check
                                | A value for DA not supported by the BIOS was specified.
                 ---------------+------------------------------------------
Description    o This sets the FDD motor to a mode that automatically stops if there is no disk access for a certain period of time.
                 Once set to this mode, the BIOS cannot return the motor to constant-on mode.
                 Constant-on mode can be achieved by setting I/O 00BEh bit 2 (EMTON) = 0.
               u Some models are set to motor stop mode from startup, and some models allow you to select the startup mode in the setup menu.
               o When executed on a model that does not have this function, the same processing as AH=03h is performed
                 and the function terminates normally. In this case, 0000:0480h bit 4 will not be set to 1 after executing this function.
               o The PC-9801UX supports the I/O 00BEh bit 2 (EMTON) bit, but the BIOS does not support this function.
Related          0000:0480h bit 4
                 0000:0485h
                 INT 1Fh - Function 9A07h
INT 1Bh - Function 83h (FD)
Category         DISK BIOS
Name             New Initialization (AI Detection Enabled)
Target           Dual-Use BIOS - 640KB I/F Mode
Input            AH=83h
                 AL=DA/UA
                 ---------------------------------------+-----------
                 Access Condition                       | DA/UA Value (x=any)
                 ---------------------------------------+-----------
                 Dual-Use BIOS 640KB I/F Mode           | 7xh,Fxh
                 ---------------------------------------+-----------
Output           AH=Return Code (bits 3-0 are undefined)
                 ---------------+------------------------------------------
                 AH             | Contents
                 ---------------+------------------------------------------
                 00h (CF=0)     | Normal End
                                | Normal End
                 40h (CF=1)     | Equipment Check
                                | A value specified for DA that is not supported by the BIOS.
                 ---------------+------------------------------------------
Description    o Initializes to detect AI (Attention Interrupt). Once configured to detect AI, it cannot be reverted to AI-less mode until reset.
               o If DA is set to Fh, an error (return code 4xh) will occur in 640KB-only BIOSes that do not support this function,
                 allowing you to check whether the function is supported.
Related          0000:0500h bit 2
INT 1Bh - Function 04h (FD)
Category:        DISK BIOS
Name:            Sense (SENSE)
Target:          Dual-use BIOS, 1MB-only BIOS, 640KB-only BIOS
Input:           AH=04h
                 AL=DA/UA
                 --------------------------------------------+----------
                 Access Condition:                           | DA/UA Value (n=Device Number 0-3)
                 --------------------------------------------+----------
                 Dual-use BIOS: 1MB I/F Mode, 1MB Access     | 9nh
                 Dual-use BIOS: 1MB I/F Mode, 640KB Access   | 1nh
                 Dual-use BIOS: 1MB I/F Mode, 1.44MB Access  | 3nh
                 Dual-use BIOS: 640KB I/F Mode, 640KB Access | 7nh
                 Dual-use BIOS: 640KB I/F Mode, 1MB Access   | Fnh
                 1MB-only BIOS                               | 9nh
                 640KB-only BIOS                             | 7nh
                 --------------------------------------------+----------
Output           AH = Return Code
                 ------------+------------------------------------------
                 AH bits 7-4 | Contents
                 ------------+-----------------------------------------
                 00h (CF=0)  | Ready
                             | Media inserted (write enabled)
                 1xh (CF=0)  | Write Protect
                             | Media inserted (write protected)
                 40h (CF=1)  | Equipment Check
                             | A value specified for DA that is not supported by the BIOS
                 6xh (CF=1)  | Not Ready
                             | No disk inserted or drive connected
                 ------------+------------------------------------------
                 AH bit 3 = 0 (Unused)
                   bit 2 =
                     ■ [DA/UA=9nh,Fnh,3nh]
                       0 (Unused)
                     ■ [DA/UA=7nh,1nh]
                       Get Cylinder Mode
                         1: 80 cylinders (2DD,1DD)
                         0: 40 cylinders (2D, 1D)
                       Related: INT 1Bh - Function 8Eh (FD)
                                0000:05CAh [When DA/UA=7nh]
                                0000:0493h [When DA/UA=1nh]
                   Bit 1 = 0 (Unused)
                   Bit 0 =
                     ■ [DA/UA=9nh,Fnh,3nh]
                       Double-sided/Single-sided Media
                         1: Double-sided media is loaded
                         0: Single-sided media is loaded, no media inserted
                         * Function for 8-inch drives. 3.5-inch and 5-inch media are double-sided only.
                     ■ [DA/UA=7nh,1nh]
                       Get Side Mode
                         1: Double-sided (2DD,2D)
                         0: Single-sided (1DD,1D)
Related:         INT 1Bh - Function 0Eh (FD)
                 0000:05CAh [When DA/UA=7nh]
                 0000:0493h [When DA/UA=1nh]
Function       o Checks the status of the specified drive.
               u FD BIOS sense commands cannot determine whether a drive is actually connected.
                 This is because the return code is the same whether a floppy disk is inserted or not.
                 Whether a drive is connected is indicated in the system common area.
               u If this function is executed when the motor auto-stop mode is ON and the motor is stopped,
                 the media insertion status will not be correctly detected the first time (a "no disk inserted" error will be returned).
                 Executing it again after a short wait will allow for correct detection.
Related          0000:0488h
                 0000:0494h
                 0000:055Ch
                 INT 1Bh - Function 84h(FD)
                 INT 1Bh - Function C4h(FD)
INT 1Bh - Function 84h (FD)
Category:        Disk BIOS
Name:            New Sense
Target:          Dual-Use BIOS
Input:           AH=84h
                 AL=DA/UA
                 -----------------------------------------------+----------
                 Access Condition:                              | DA/UA Value (n=Device Number 0-3)
                 -----------------------------------------------+----------
                 Dual-Use BIOS: 1MB I/F Mode, 1MB Access        | 9nh
                 Dual-Use BIOS: 1MB I/F Mode, 640KB Access      | 1nh
                 Dual-Use BIOS: 1MB I/F Mode, 1.44MB Access     | 3nh
                 Dual-Use BIOS: 640KB I/F Mode, 640KB Access    | 7nh
                 Dual-Use BIOS: 640KB I/F Mode, 1MB Access      | Fnh
                 -----------------------------------------------+----------
Output:          AH=Return Code
                 ------------+------------------------------------------
                 AH bits 7-4 |Contents
                 ------------+------------------------------------------
                 00h (CF=0)  | Ready
                             | Media inserted (write enabled)
                 1xh (CF=0)  | Write Protect
                             | Media inserted (write protected)
                 40h (CF=1)  | Equipment Check
                             | DA value specified for BIOS not supported
                 6xh (CF=1)  | Not Ready
                             | Disk not inserted or drive not connected
                 ------------+------------------------------------------
                 AH bit 3 = Dual-purpose drive identification
                   1: Dual-purpose drive
                   0: Non-dual-purpose drive
                   Related: I/O 0094h bits 3, 2 [1MB I/F mode]
                            I/O 00CCh bits 3, 2 [640KB I/F mode]
                            INT 1Bh - Function C4h (FD) bit 3
                 bit 2 =
                   ■ [DA/UA=9nh,Fnh,3nh]
                     0 (Unused)
                   ■ [DA/UA=7nh,1nh]
                     Get cylinder mode
                       1: 80 cylinders (2DD,1DD)
                       0: 40 cylinders (2D,1D)
                       Related: INT 1Bh - Function 8Eh (FD)
                                0000:05CAh [When DA/UA=7nh]
                                0000:0493h [When DA/UA=1nh]
                 bit 1 =
                   ■ [DA/UA=9nh,1nh,Fnh,3nh]
                     0 (Unused)
                   ■ [DA/UA=7nh]
                     Attention Interrupt (AI) Enabled
                       1: No AI
                       0: AI Enabled
                       Related: 0000:0500h bit 2
                  bit 0 =
                    ■ [DA/UA=9nh,Fnh,3nh]
                      Double-sided/Single-sided Media Identification
                        1: Double-sided media is inserted.
                        0: Single-sided media is inserted, or no media is inserted.
                        * Function for 8-inch drives. 3.5-inch and 5-inch drives always use double-sided media.
                    ■ [DA/UA=7nh,1nh]
                      Get side mode
                        1: Double-sided (2DD,2D)
                        0: Single-sided (1DD,1D)
                        Related: INT 1Bh - Function 0Eh (FD)
                                 0000:05CAh [When DA/UA=7nh]
                                 0000:0493h [When DA/UA=1nh]
                                 Description o Checks the status of the drive with the specified DA/UA.
                                               Can check whether it is a dual-sided drive.
                                             o In a 1MB/640KB dedicated BIOS, executing INT 1Bh with AH=84h will process INT 1Bh - Function 04h (FD).
                                               When checking for attention interrupts, it is recommended to specify DA/UA=1nh (in 1MB I/F mode) or
                                               DA/UA=Fnh (in 640KB I/F mode). When executed in an environment that is not a dual-purpose BIOS,
                                               an Equipment Check error (AH=4xh) occurs, making it easy to see that this function is not actually supported.
                                               DA/UA=3nh can only be used with a 1.44MB dual-purpose BIOS.
                                               DISK BIOS sense commands cannot be used to determine whether a drive is actually connected.
                                               This is because the return code is the same whether a floppy disk is inserted or not.
                                               You can check whether a drive is connected by checking the system common area.
                                               If this function is executed when the motor auto-stop mode is ON and the motor is stopped,
                                               the media insertion status will not be detected correctly the first time it is executed
                                               (a no-disk error will be returned). Executing it again after a short wait will allow the correct detection.
                                               The PC-FD321F (a 1.44MB 3.5" FDD for file slot) installed in the file slot can always operate as a
                                               dual-purpose drive. However, the dual-purpose drive identification result (AH bit 3) returned by
                                               INT 1Bh - Function 84h, C4h varies depending on the system configuration as follows.
                 [PC-FD321F Dual-purpose Drive Identification Result]
                 -------------------------------------------------------+------------------------+-------------------
                 System Configuration                                   | Function 84h           | Function C4h
                 -------------------------------------------------------+------------------------+-------------------
                 1.44MB Non-compatible                                  | Non-Dual (bit 3 = 0)   | No Function (same as 84h)
                 1.44MB compatible, two internal floppy disks,          |                        |
                 1MB I/F Mode                                           | Non-Dual (bit 3 = 0)   | Dual (bit 3 = 1)
                 1.44MB compatible, one internal floppy disk,           |                        |
                 1MB I/F Mode                                           | Dual (bit 3=1)         | Dual-use (bit 3=1)
                 1.44MB-compatible machine, two internal floppy disks,  |                        |
                 640KB I/F mode                                         | Non-dual-use (bit 3=0) | Non-dual-use (bit 3=0)
                 1.44MB-compatible machine, one internal floppy disk,   |                        |
                 640KB I/F mode                                         | Dual-use (bit 3=1)     | Dual-use (bit 3=1)
                 -------------------------------------------------------+------------------------+-------------------
                 The PC-FD511F (1MB 5" FDD for file slot) installed in the file slot can always operate as a dual-use drive,
                 but the dual-use drive identification result (AH bit 3) returned by INT 1Bh - Function 84h (FD) and
                 INT 1Bh - Function C4h (FD) varies depending on the machine's conditions as follows:
                 [PC-FD511F Dual-Use Drive Identification Results]
                 ---------------------------------------------------------------+-------------------------------+-------------------
                 System Requirements                                            | Function 84h                  | Function C4h
                 ---------------------------------------------------------------+-------------------------------+-------------------
                 1.44MB Non-Compatible *1                                       | Non-Dual-Use (bit 3 = 0)      | No Function (same as 84h)
                 1.44MB Compatible Machine with Two Internal Floppy Drives *2   | Non-Dual-Use (bit 3 = 0)      | Non-Dual-Use (bit 3 = 0)
                 1.44MB Compatible Machine with One Internal Floppy Drive *3    | Dual-Use (bit 3 = 1)          | Dual-Use (bit 3 = 1)
                 ---------------------------------------------------------------+-------------------------------+-------------------
                 *1: PC-9801FA/FS/FX, PC-H98 model 105, etc.
                 *2: PC-9821Ap/As/Ae/Ap2/As Floppy Disk Models
                 *3: Hard disk models of PC-9821Af, Ap, As, Ae, Ap2, and As2
                 The PC-9801-F04 (1MB 3.5" FDD for file slot) installed in the file slot is 1MB only when used with any model.
                 However, by shorting jumper J1 on the PC-9801-F04 board, it can be used as a dual-purpose drive, just like the PC-FD511F.
Related          0000:0494h
                 0000:055Ch
                 INT 1Bh - Function 04h (FD)
                 INT 1Bh - Function C4h (FD)
INT 1Bh - Function C4h (FD)
Category:        Disk BIOS
Name:            New Sense 2
                 Undocumented
Target:          1.44MB Dual-Use BIOS (1MB I/F Mode)
Input:           AH=C4h
                 AL=DA/UA (3nh recommended)
                 -----------------------------------------------+----------
                 Access Condition:                              | DA/UA Value (n=Device Number 0-3)
                 -----------------------------------------------+----------
                 Dual-Use BIOS 1MB I/F Mode, 1MB Access         | 9nh
                 Dual-Use BIOS 1MB I/F Mode, 640KB Access       | 1nh
                 Dual-Use BIOS 1MB I/F Mode, 1.44MB Access      | 3nh
                 -----------------------------------------------+----------
Output:          AH=Return Code
                 -----------------------------------------------+------------------------------------------
                 AH bits 7-4                                    | Contents
                 -----------------------------------------------+------------------------------------------
                 00h (CF=0)                                     | Ready
                                                                | Media inserted (write enabled)
                 1xh (CF=0)                                     | Write Protect
                                                                | Media inserted (write protected)
                 40h (CF=1)                                     | Equipment Check
                                                                | DA value specified for BIOS not supported
                 6xh (CF=1)                                     | Not Ready
                                                                | Disk not inserted or drive not connected
                 -----------------------------------------------+------------------------------------------
                 AH bit 3 = Dual-purpose drive identification
                   1: Dual-purpose drive
                   0: Non-dual-purpose drive
                   Related: I/O 0094h bits 3, 2 [1MB I/F mode]
                            I/O 00CCh bits 3, 2 [640KB I/F mode]
                            0000:05AEh [1.44MB-capable device]
                            INT 1Bh - Function 84h (FD) bit 3
                 bit 2 = 1.44MB-capable drive identification
                   1: 1.44MB-capable drive
                   0: Drive not compatible with 1.44MB
                 bit 1,0 = INT 1Bh - Same as Function 84h (FD)
                           Description o Checks the status of the drive for the specified DA/UA.
                                         Can check whether the drive is 1.44MB compatible.
                                       o 1.44MB access is only possible on 3.5-inch floppy disk drives set to 1MB I/F mode on
                                         1.44MB-compatible machines. Even on 1.44MB-compatible machines, 1.44MB access is not
                                         possible when set to 640KB I/F mode. Also, 5-inch drives cannot handle the 1.44MB format.
                                       u DISK BIOS sense commands cannot be used to determine whether a drive is actually connected.
                                         This is because the return code is the same whether a floppy disk is inserted or not.
                                         You can check whether a drive is connected by checking the system common area.
                                         If you execute this function when the motor auto-stop mode is ON and the motor is stopped,
                                         the media loading status will not be detected correctly the first time it is executed
                                         (a "no disc inserted" error will be returned). If you execute it again after a short wait,
                                         it will be detected correctly.
                                         To check for 1.44MB support, specify DA/UA=3nh.
                                         If this function is executed on a machine that does not support 1.44MB, the same processing
                                         as function 84h will be performed. For this reason, you will not be able to obtain information
                                         from bit 2 about whether or not 1.44MB is supported. The same applies when a 1.44MB-compatible
                                         machine is set to 640KB I/F mode.
                                         If you specify DA/UA=3nh, an Equipment Check error (AH=4xh) will occur in an environment that
                                         does not support 1.44MB, making it easy to see that 1.44MB access is not possible.
                                       u If a DISK BIOS command is executed with DA/UA=3xh on a non-1.44MB-compatible drive (such as an
                                         internal or external 5-inch FDD, an external 3.5-inch FDD, or a PC-9801-F04 or PC-FD511F
                                         installed in a file slot) connected to a 1.44MB-compatible machine, it will not necessarily
                                         terminate abnormally. It will terminate normally if media is inserted in the specified drive.
                                         To check whether 1.44MB is accessible, you must always check bit 2 of the return code.
                                       u The result of bit 3 differs from that of INT 1Bh - Function 84h (FD) depending on the machine's conditions.
                                         See INT 1Bh - Function 84h (FD).
Related          0000:0494h
                 0000:055Ch
                 0000:05AEh
                 INT 1Bh - Function 04h(FD)
                 INT 1Bh - Function 84h(FD)
                 INT 1Bh - Function C4h(FD)
INT 1Bh - Function 05h (FD)
Category:        Disk BIOS
Name:            Write Data (WRITE DATA)
Target:          Dual-use BIOS, 1MB-only BIOS, 640KB-only BIOS
Input:           AH bit 7 = MT
                     1 = Multi-track [PC-H98]
                     0 = Single-track
                     * Multi-track cannot be specified on devices other than the PC-H98
                   bit 6 = MF
                     1 = Double-density (MFM)
                     0 = Single-density (FM)
                   bit 5 = r
                     1 = No retries
                     0 = 8 retries
                   bit 4 = SEEK
                     1 = Seek operation
                     0 = Access current track position
                   bit 3-0 = 0101b
                 AL = DA/UA
                 -------------------------------------------+----------
                 Access Condition                           | DA/UA value (n = device number 0-3)
                 -------------------------------------------+----------
                 Dual-use BIOS, 1MB I/F mode, 1MB access    | 9nh
                 Dual-use BIOS 1MB I/F mode, 640KB access   | 1nh
                 Dual-use BIOS 1MB I/F mode, 1.44MB access  | 3nh
                 Dual-use BIOS 640KB I/F mode, 640KB access | 7nh
                 Dual-use BIOS 640KB I/F mode, 1MB access   | Fnh
                 1MB-only BIOS                              | 9nh
                 640KB-only BIOS                            | 7nh
                 -------------------------------------------+----------
                 BX = Number of bytes transferred
                 CH = Sector length
                   00h = 128 bytes/sector
                   01h = 256 bytes/sector
                   02h = 512 bytes/sector
                   03h = 1024 bytes/sector
                 CL = Cylinder number (only if SEEK bit = 1)
                 -----------------+------------------
                 Drive type       | Cylinder number range
                 -----------------+------------------
                 3.5-inch, 5-inch | 0-79d
                 8-inch           | 0-76d
                 -----------------+------------------
                 DH=Head Number
                 -------------------------------------+----------------
                 Media/Mode Type                      | Head Number Range
                 -------------------------------------+----------------
                 Double-Sided Media/Double-Sided Mode | 0-1
                 Single-Sided Media/Single-Sided Mode | 0
                 -------------------------------------+----------------
                 * Single-sided media is only available for 8-inch media, and single-sided mode is only available in 640KB access mode.
                 DL = Sector Number
                   (1 to maximum value depends on the format)
                 ES:BP = Buffer Address
Output           AH = Return Code (bits 3 to 0 are undefined)
                 -----------+------------------------------------------
                 AH         | Content
                 ------------+------------------------------------------
                 00h (CF=0) | Normal End
                            | Successful completion
                 2xh (CF=1) | DMA Boundary
                            | The transfer area crosses a 64KB boundary
                 3xh (CF=1) | End Of Cylinder
                            | An attempt was made to transfer across cylinders
                 40h (CF=1) | Equipment Check
                            | A value was specified for DA that is not supported by the BIOS
                 5xh (CF=1) | Over Run
                            | Data transfer did not finish within the specified time
                 6xh (CF=1) | Not Ready
                            | No disk is inserted or the drive is not connected
                 7xh (CF=1) | Not Writable
                            | Write-protected
                 Axh (CF=1) | Data Error
                            | CRC error occurred
                            | CRC error occurred when reading ID
                 Cxh(CF=1)  | No Data
                            | Specified sector not found
                 Exh(CF=1)  | Missing Address Mark
                            | ID address mark not found
                 -----------+------------------------------------------
Description    o Writes data to the specified sector. Writes DAM (Data Address Mark) to the sector's data field.
                 This function is used for normal writes.
               o When MT=0 (single track specified), BX (number of transfer bytes) must be set so that a single transfer is completed within the same track on one side of the disk.
                 When MT=1 (multi-track specified), BX (number of transfer bytes) must be set so that a single transfer is completed within the same cylinder on both sides of the disk.
                 Cross-cylinder transfers are not possible.
               o ES:BP (transfer address) and BX (number of transfer bytes) must be set so that the transfer area does not cross a 64KB physical address boundary.
                 For example, it is not possible to transfer to an area such as ES:BP=7000:FF00h, BX=0400h.
               o If the value specified for BX (number of bytes to transfer) is not an integer multiple of the sector length,
                 00h will be written to the part of the last sector where there is no transfer data.
Related          INT 1Bh - Function 09h(FD)
INT 1Bh - Function 06h (FD)
Category:        Disk BIOS
Name:            Read Data (READ DATA)
Target:          Dual-Use BIOS, 1MB-Only BIOS, 640KB-Only BIOS
Input:           AH bit 7 = MT
                     1 = Multi-Track
                     0 = Single-Track
                   bit 6 = MF
                     1 = Double-Density (MFM)
                     0 = Single-Density (FM)
                   bit 5 = r
                     1 = No Retry
                     0 = 8 Retry Counts
                   bit 4 = SEEK
                     1 = Seek Operation
                     0 = Access Current Track Position
                   bits 3-0 = 0110b
                 AL = DA/UA
                 -------------------------------------------+-----------------------
                 Access Condition:                          | DA/UA Value (n = Device Number 0-3)
                 -------------------------------------------+-----------------------
                 Dual-Use BIOS 1MB I/F Mode, 1MB Access     | 9nh
                 Dual-Use BIOS 1MB I/F Mode, 640KB Access   | 1nh
                 Dual-Use BIOS 1MB I/F mode, 1.44MB access  | 3nh
                 Dual-use BIOS 640KB I/F mode, 640KB access | 7nh
                 Dual-use BIOS 640KB I/F mode, 1MB access   | Fnh
                 1MB-only BIOS                              | 9nh
                 640KB-only BIOS                            | 7nh
                 -------------------------------------------+-----------------------
                 BX = Number of bytes transferred
                 CH = Sector length
                   00h = 128 bytes/sector
                   01h = 256 bytes/sector
                   02h = 512 bytes/sector
                   03h = 1024 bytes/sector
                 CL = Cylinder number (only if SEEK bit = 1)
                 -----------------+------------------
                 Drive type       | Cylinder number range
                 -----------------+------------------
                 3.5-inch, 5-inch | 0-79d
                 8-inch           | 0-76d
                 -----------------+------------------
                 DH=Head Number
                 -------------------------------------+----------------
                 Media/Mode Type                      | Head Number Range
                 -------------------------------------+----------------
                 Double-Sided Media/Double-Sided Mode | 0-1
                 Single-Sided Media/Single-Sided Mode | 0
                 -------------------------------------+----------------
                 * Single-sided media is only available in 8-inch format, and single-sided mode is only available in 640KB access mode.
                 DL = Sector Number
                   (1 to maximum value depends on the format)
                 ES:BP = Buffer Address
Output           AH = Return Code (bits 3 to 0 are undefined)
                 -----------+------------------------------------------
                 AH         | Content
                 -----------+------------------------------------------
                 00h (CF=0) | Normal End
                            | Normal End
                 1xh (CF=0) | Control Mark
                            | DDAM (Deleted Data Address Mark) detected
                 2xh (CF=1) | DMA Boundary
                            | Transfer area crosses a 64KB boundary
                 3xh (CF=1) | End Of Cylinder
                            | Transfer attempt across cylinders
                 40h (CF=1) | Equipment Check
                            | DA value specified is not supported by the BIOS
                 5xh (CF=1) | Over Run
                            | Data transfer did not finish within the specified time
                 6xh (CF=1) | Not Ready
                            | No disk inserted or drive connected
                 Axh(CF=1)  | Data Error
                            | CRC error occurred
                 Cxh(CF=1)  | No Data
                            | Specified sector not found
                 Exh(CF=1)  | Missing Address Mark
                            | ID address mark not found
                 -----------+------------------------------------------
Description    o Reads data from the specified sector.
                 If a DDAM (Deleted Data Address Mark) is detected, the function returns AH=01h and aborts processing.
                 This function is used for normal reads.
               o When MT=0 (single track specified), BX (number of bytes transferred) must be set so that a single transfer is completed within the same track on one side of the disk.
                 When MT=1 (multi-track specified), BX (number of bytes transferred) must be set so that a single transfer is completed within the same cylinder on both sides of the disk.
                 Cross-cylinder transfers are not possible.
               o ES:BP (transfer address) and BX (transfer byte count) must be set so that the transfer area does not cross a 64KB physical address boundary.
                 For example, a transfer to an area such as ES:BP=7000:FF00h, BX=0400h is not possible.
               o The value specified for BX (transfer byte count) does not need to be an integer multiple of the sector length. Data of the same length as the specified value will actually be transferred.
Related          INT 1Bh - Function 01h (FD)
                 INT 1Bh - Function 02h (FD)
                 INT 1Bh - Function 0Ch (FD)
INT 1Bh - Function 07h (FD)
Category:        DISK BIOS
Name:            Seek to cylinder 0 (RECALIBRATE)
Target:          Dual-use BIOS, 1MB-only BIOS, 640KB-only BIOS
Input:           AH=07h
                 AL=DA/UA
                 ---------------------------------------+-----------
                 Access Condition:                      | DA/UA Value (n=Device Number 0-3)
                 ---------------------------------------+-----------
                 Dual-use BIOS: 1MB I/F Mode:           | 9nh, 1nh, 3nh
                 Dual-use BIOS: 640KB I/F Mode:         | 7nh, Fnh
                 1MB-only BIOS:                         | 9nh
                 640KB-only BIOS:                       | 7nh
                 ---------------------------------------+-----------
Output:          AH=Return Code (Bits 3-0 are undefined)
                 -----------+------------------------------------------
                 AH         | Contents
                 -----------+------------------------------------------
                 00h (CF=0) | Normal End
                            | Normal End
                 40h (CF=1) | Equipment Check
                            | A value specified for DA that is not supported by the BIOS was specified.
                 6xh (CF=1) | Not Ready
                            | No disk is inserted or the drive is not connected.
                 -----------+------------------------------------------
Description    o Seeks the head to cylinder 0.
               o If an error occurs during disk access, seeking the head to cylinder 0 and then retrying the access may result in successful access.
Related
INT 1Bh - Function 09h (FD)
Category:        Disk BIOS
Name:            Write Deleted Data (WRITE DELETED DATA)
Target:          Dual-use BIOS, 1MB-only BIOS
Input:           AH bit 7 = MT
                     1 = Multi-track [PC-H98]
                     0 = Single-track
                     * Multi-track cannot be specified on devices other than the PC-H98
                   bit 6 = MF
                     1 = Double-density (MFM)
                     0 = Single-density (FM)
                   bit 5 = r
                     1 = No retries
                     0 = 8 retries
                   bit 4 = SEEK
                     1 = Seek operation
                     0 = Access current track position
                   bit 3-0 = 1001b
                 AL = DA/UA
                 -------------------------------------------+----------
                 Access Condition:                          | DA/UA value (n = device number 0-3)
                 -------------------------------------------+----------
                 Dual-use BIOS, 1MB I/F mode, 1MB access    | 9nh
                 Dual-use BIOS 1MB I/F mode, 640KB access   | 1nh
                 Dual-use BIOS 1MB I/F mode, 1.44MB access  | 3nh
                 Dual-use BIOS 640KB I/F mode, 640KB access | 7nh
                 Dual-use BIOS 640KB I/F mode, 1MB access   | Fnh
                 1MB-only BIOS                              | 9nh
                 -------------------------------------------+----------
                 BX = Number of bytes transferred
                 CH = Sector length
                   00h = 128 bytes/sector
                   01h = 256 bytes/sector
                   02h = 512 bytes/sector
                   03h = 1024 bytes/sector
                 CL = Cylinder number (only if SEEK bit = 1)
                 -----------------+------------------
                 Drive type       | Cylinder number range
                 -----------------+------------------
                 3.5-inch, 5-inch | 0-79d
                 8 inches         | 0-76d
                 -----------------+------------------
                 DH = Head Number
                 -------------------------------------+----------------
                 Media/Mode Type                      | Head Number Range
                 -------------------------------------+----------------
                 Double-Sided Media/Double-Sided Mode | 0-1
                 Single-Sided Media/Single-Sided Mode | 0
                 -------------------------------------+----------------
                 * Single-sided media is only available in 8-inch format, and single-sided mode is only available in 640KB access mode.
                 DL = Sector Number
                   (1 to maximum value depends on the format)
                 ES:BP = Buffer Address
Output           AH = Return Code (bits 3 to 0 are undefined)
                 -----------+------------------------------------------
                 AH         | Content
                 -----------+------------------------------------------
                 00h (CF=0) | Normal End
                            | Successful completion
                 2xh (CF=1) | DMA Boundary
                            | The transfer area crosses a 64KB boundary
                 3xh (CF=1) | End Of Cylinder
                            | An attempt was made to transfer across cylinders
                 40h (CF=1) | Equipment Check
                            | A value was specified for DA that is not supported by the BIOS
                 5xh (CF=1) | Over Run
                            | Data transfer did not finish within the specified time
                 6xh (CF=1) | Not Ready
                            | No disk is inserted or the drive is not connected
                 7xh (CF=1) | Not Writable
                            | Write-protected
                 Axh (CF=1) | Data Error
                            | CRC error occurred when reading ID
                 Cxh(CF=1)  | No Data
                            | Specified sector not found
                 Exh(CF=1)  | Missing Address Mark
                            | ID address mark not found
                 -----------+------------------------------------------
Description    o Writes data to the specified sector. DDAM (Deleted Data Address Mark) is written to the sector's data field.
               o When MT=0 (single track specified), BX (number of transfer bytes) must be set so that a single transfer is completed within the same track on one side of the disk.
               o When MT=1 (multi-track specified), BX (number of transfer bytes) must be set so that a single transfer is completed within the same cylinder on both sides of the disk.
                 Cross-cylinder transfers are not possible.
               o ES:BP (transfer address) and BX (number of transfer bytes) must be set so that the transfer area does not cross a 64KB physical address boundary.
                 For example, data cannot be transferred to an area such as ES:BP=7000:FF00h, BX=0400h.
               o If the value specified for BX (number of bytes to transfer) is not an integer multiple of the sector length,
                 00h will be written to the portion of the last sector where there is no data to transfer.
Related:         INT 1Bh - Function 05h(FD)
                 INT 1Bh - Function 0Ch(FD)
INT 1Bh - Function 0Ah (FD)
Category:        Disk BIOS
Name:            Read ID (READ ID)
Target:          Dual-use BIOS, 1MB-only BIOS, 640KB-only BIOS
Input:           AH bit 7 = 0
                   bit 6 = MF
                     1 = Double-density (MFM)
                     0 = Single-density (FM)
                   bit 5 = r
                     1 = No retries
                     0 = 8 retries
                   bit 4 = SEEK
                     1 = Seek operation
                     0 = Access current track position
                   bits 3-0 = 1010b
                 AL = DA/UA
                 -------------------------------------------+----------
                 Access Condition:                          | DA/UA value (n = device number 0-3)
                 -------------------------------------------+----------
                 Dual-use BIOS 1MB I/F mode, 1MB access     | 9nh
                 Dual-use BIOS 1MB I/F mode, 640KB access   | 1nh
                 Dual-use BIOS 1MB I/F mode , 1.44MB access | 3nh
                 Dual-use BIOS 640KB I/F mode, 640KB access | 7nh
                 Dual-use BIOS 640KB I/F mode, 1MB access   | Fnh
                 1MB-only BIOS                              | 9nh
                 640KB-only BIOS                            | 7nh
                 -------------------------------------------+----------
                 CL = Cylinder number (only if SEEK bit = 1)
                 -----------------+------------------
                 Drive type       | Cylinder number range
                 -----------------+------------------
                 3.5-inch, 5-inch | 0-79d
                 8-inch           | 0-76d
                 -----------------+------------------
                 DH = Head number
                 -------------------------------------+----------------
                 Media/mode type                      | Head number range
                 -------------------------------------+----------------
                 Double-sided media/Double-sided mode | 0-1
                 Single-sided media/Single-sided mode | 0
                 -------------------------------------+----------------
                 * Single-sided media is only available in 8-inch format, and single-sided mode is only available in 640KB access mode.
Output           AH = Return Code (bits 3-0 are undefined)
                 -----------+------------------------------------------
                 AH         | Content
                 -----------+------------------------------------------
                 00h (CF=0) | Normal End
                            | Normal End
                 40h (CF=1) | Equipment Check
                            | A value was specified for DA that the BIOS does not support.
                 6xh (CF=1) | Not Ready
                            | No disk is inserted or the drive is not connected.
                 Cxh (CF=1) | No Data
                            | The correct ID was not found even after reading one track.
                 Exh (CF=1) | Missing Address Mark
                            | The ID address mark was not found.
                 -----------+------------------------------------------
                 CH = Sector Length
                   00h = 128 bytes/sector
                   01h = 256 bytes/sector
                   02h = 512 bytes/sector
                   03h = 1024 bytes/sector
                 CL = Cylinder Number
                 DH = Head Number
                 DL = Sector Number
Description:     Reads the first valid ID found in the track and returns the sector length, cylinder number, head number, and sector number.
Related
INT 1Bh - Function 0Ch (FD)
Category:        Disk BIOS
Name:            Read Deleted Data (READ DELETED DATA)
Target:          Dual-use BIOS, 1MB-only BIOS
Input:           AH bit 7 = MT
                     1 = Multi-track
                     0 = Single-track
                   bit 6 = MF
                     1 = Double-density (MFM)
                     0 = Single-density (FM)
                   bit 5 = r
                     1 = No retries
                     0 = 8 retries
                   bit 4 = SEEK
                     1 = Seek operation
                     0 = Access current track position
                   bits 3-0 = 1100b
                 AL = DA/UA
                 -------------------------------------------+----------
                 Access Condition:                          | DA/UA value (n = device number 0-3)
                 -------------------------------------------+----------
                 Dual-use BIOS 1MB I/F mode, 1MB access     | 9nh
                 Dual-use BIOS 1MB I/F mode, 640KB access   | 1nh
                 Dual-use BIOS 1MB I/F mode, 1.44MB access  | 3nh
                 Dual-use BIOS 640KB I/F mode, 640KB access | 7nh
                 Dual-use BIOS 640KB I/F mode, 1MB access   | Fnh
                 1MB-only BIOS                              | 9nh
                 -------------------------------------------+----------
                 BX = Number of bytes transferred
                 CH = Sector length
                   00h = 128 bytes/sector
                   01h = 256 bytes/sector
                   02h = 512 bytes/sector
                   03h = 1024 bytes/sector
                 CL = Cylinder number (only if SEEK bit = 1)
                 -----------------+------------------
                 Drive type       | Cylinder number range
                 -----------------+------------------
                 3.5-inch, 5-inch | 0-79d
                 8-inch           | 0-76d
                 -----------------+------------------
                 DH = Head number
                 -------------------------------------+----------------
                 Media/Mode Type                      | Head Number Range
                 -------------------------------------+----------------
                 Double-Sided Media/Double-Sided Mode | 0-1
                 Single-Sided Media/Single-Sided Mode | 0
                 -------------------------------------+----------------
                 * Single-sided media is only available in 8-inch format, and single-sided mode is only available in 640KB access mode.
                 DL = Sector Number
                   (1 to maximum value depends on the format)
                 ES:BP = Buffer Address
Output           AH = Return Code (bits 3 to 0 are undefined)
                 -----------+------------------------------------------
                 AH         | Content
                 -----------+------------------------------------------
                 1xh (CF=0) | Control Mark
                            | DDAM (Deleted Data Address Mark) detected
                 2xh (CF=1) | DMA Boundary
                            | Transfer area crosses a 64KB boundary
                 3xh (CF=1) | End Of Cylinder
                            | Transfer attempt across cylinders attempted
                 40h (CF=1) | Equipment Check
                            | DA value specified is not supported by the BIOS
                 5xh (CF=1) | Over Run
                            | Data transfer did not finish within the specified time
                 6xh (CF=1) | Not Ready
                            | Disk not inserted or drive not connected
                 Axh (CF=1) | Data Error
                            | CRC error occurred
                 Cxh (CF=1) | No Data
                            | Specified sector not found
                 Exh (CF=1) | Missing Address Mark
                            | ID address mark not found
                 -----------+------------------------------------------
Explanation    o Reads from the sector where DDAM (Deleted Data Address Mark) is written.
               o When MT=0 (single track specified), BX (number of transfer bytes) must be set so that a single transfer is completed within the same track on one side of the disk.
               o When MT=1 (multi-track specified), BX (number of transfer bytes) must be set so that a single transfer is completed within the same cylinder on both sides of the disk.
                 Cross-cylinder transfers are not possible.
               o ES:BP (transfer address) and BX (number of transfer bytes) must be set so that the transfer area does not cross a 64KB physical address boundary.
                 For example, a transfer to an area such as ES:BP=7000:FF00h, BX=0400h is not possible.
                 The value specified for BX (number of bytes to transfer) does not need to be an integer multiple of the sector length.
                 The actual length of data transferred is the same as the specified value.
Related:         INT 1Bh - Function 06h (FD)
                 INT 1Bh - Function 09h (FD)
INT 1Bh - Function 0Dh (FD)
Category:        Disk BIOS
Name:            Track Format (FORMAT TRACK)
Target:          Dual-use BIOS, 1MB-only BIOS, 640KB-only BIOS
Input:           AH bit 7 = 0
                   bit 6 = MF
                     1 = Double-density (MFM)
                     0 = Single-density (FM)
                   bit 5 = r
                     1 = No retries
                     0 = 8 retries
                   bit 4 = SEEK
                     1 = Seek operation
                     0 = Access current track position
                   bits 3-0 = 1101b
                 AL = DA/UA
                 -------------------------------------------+----------
                 Access Condition:                          | DA/UA value (n = device number 0-3)
                 -------------------------------------------+----------
                 Dual-use BIOS 1MB I/F mode, 1MB access     | 9nh
                 Dual-use BIOS 1MB I/F mode, 640KB access   | 1nh
                 Dual-use BIOS 1MB I/F mode , 1.44MB access | 3nh
                 Dual-use BIOS 640KB I/F mode, 640KB access | 7nh
                 Dual-use BIOS 640KB I/F mode, 1MB access   | Fnh
                 1MB-only BIOS                              | 9nh
                 640KB-only BIOS                            | 7nh
                 ------------------------------------------+----------
                 BX = Number of bytes of formatting data
                 CH = Sector length
                   00h = 128 bytes/sector
                   01h = 256 bytes/sector
                   02h = 512 bytes/sector
                   03h = 1024 bytes/sector
                 CL = Cylinder number (only if SEEK bit = 1)
                 -----------------+------------------
                 Drive type       | Cylinder number range
                 -----------------+------------------
                 3.5-inch, 5-inch | 0-79d
                 8-inch           | 0-76d
                 -----------------+------------------
                 DH=Head Number
                 -------------------------------------+----------------
                 Media/Mode Type                      | Head Number Range
                 -------------------------------------+----------------
                 Double-Sided Media/Double-Sided Mode | 0-1
                 Single-Sided Media/Single-Sided Mode | 0
                 -------------------------------------+----------------
                 * Single-sided media is only available in 8-inch format, and single-sided mode is only available in 640KB access mode.
                 DL = Data pattern written to the data section
                 ES:BP = Starting address of the data buffer area for formatting
Output           AH = Return code (bits 3-0 are undefined)
                 -----------+------------------------------------------
                 AH         | Content
                 -----------+------------------------------------------
                 00h (CF=0) | Normal End
                            | Successful completion
                 2xh (CF=1) | DMA Boundary
                            | The transfer area crosses a 64KB boundary
                 40h (CF=1) | Equipment Check
                            | A value specified for DA that is not supported by the BIOS was specified
                 5xh (CF=1) | Over Run
                            | Data transfer did not finish within the specified time
                 6xh (CF=1) | Not Ready
                            | No disk is inserted or the drive is not connected
                 7xh (CF=1) | Not Writable
                            | Write-protected
                 -----------+------------------------------------------
Description    o Formats the specified track.
               o For information on how to set the formatting data buffer, refer to the Technical Data Book.
               o ES:BP (starting address of the formatting data buffer area) and BX (number of bytes of formatting data) must be set so that the area
                 does not cross a 64K byte physical address boundary. For example, it is not possible to set an area such as ES:BP=7000:FFF0h, BX=0020h.
INT 1Bh - Function 0Eh (FD)
Category:        Disk BIOS
Name:            Set Operation Mode (1)
Target:          Dual-use BIOS, 640KB-only BIOS
Input:           AH = 0Eh
                 AL bits 7-4 = DA
                   --------------------------------------------+----------
                   Access Condition: DA Value
                   --------------------------------------------+----------
                   Dual-use BIOS: 1MB I/F mode, 640KB access   | 1h
                   Dual-use BIOS: 640KB I/F mode, 640KB access | 7h
                   640KB-only BIOS                             | 7h
                   --------------------------------------------+----------
                   bit 3: Unit #3
                   bit 2: Unit #2
                   bit 1: Unit #1
                   bit 0: Unit #0
                     1 = Double-sided mode (2DD, 2D)
                     0 = Single-sided mode (1DD, 1D)
Output:          AH = Return code (bits 3-0 are undefined)
                 -----------+------------------------------------------
                 AH         | Contents
                 -----------+------------------------------------------
                 00h (CF=0) | Normal End
                            | Normal End
                 40h (CF=1) | Equipment Check
                            | DA value specified for which no supported BIOS exists
                 -----------+------------------------------------------
Description    o Specifies the operating mode (double-sided/single-sided) in 640KB access mode.
                 At startup, all drives are set to double-sided, 80-cylinder mode (2DD).
                 By changing the operating mode, you can access (read/write/format) 1DD and 1D format media in 640KB access mode.
               u According to the Technical Data Book, this is only valid in dual-use BIOS - 1MB I/F mode, but it is also valid in 640KB-only BIOS and dual-use BIOS - 640KB I/F mode.
               o Specifying Fh for DA can also change the operating mode in 640KB access mode, but it is more practical to specify 7h for DA.
Related          0000:05CAh [640KB dedicated BIOS, dual-use BIOS - 640KB I/F mode]
                 0000:0493h [Dual-use BIOS - 1MB I/F mode]
                 INT 1Bh - Function 8Eh (FD)
INT 1Bh - Function 8Eh (FD)
Category         DISK BIOS
Name             SET OPERATION MODE(2)
Target           Dual-use BIOS, 640KB dedicated BIOS
Input            AH=8Eh
                 AL bits 7-4=DA
                   -------------------------------------------+----------
                   Access Condition DA value
                   -------------------------------------------+----------
                   Dual-use BIOS 1MB I/F mode, 640KB access   | 1h
                   Dual-use BIOS 640KB I/F mode, 640KB access | 7h
                   640KB dedicated BIOS                       | 7h
                   -------------------------------------------+----------
                   bit 3: UNIT#3
                   bit 2: UNIT#2
                   bit 1: UNIT#1
                   bit 0: UNIT#0
                     1 = 80 cylinder mode (double track...2DD/1DD)
                     0 = 40 cylinder mode (non-double track...2D/1D)
Output           AH = Return code (bits 3-0 are undefined)
                 -----------+------------------------------------------
                 AH         | Content
                 -----------+------------------------------------------
                 00h (CF=0) | Normal End
                            | Successful completion
                 40h (CF=1) | Equipment Check
                            | A value was specified for DA that the BIOS does not support.
                 -----------+------------------------------------------
Description    o Specifies the operating mode (80 cylinders/40 cylinders) for 640KB access mode.
                 At startup, all drives are set to double-sided, 80 cylinder mode (2DD).
                 By changing the operating mode, you can access (read/write/format) 2D and 1D format media in 640KB access mode.
               u The Technical Data Book states this is only valid in dual-use BIOS - 1MB I/F mode, but it is also valid in 640KB-only BIOS and dual-use BIOS - 640KB I/F mode.
               o Specifying Fh for DA also changes the operating mode in 640KB access mode, but it is more meaningful to specify 7h for DA.
Related:         0000:05CAh [640KB-only BIOS, dual-use BIOS - 640KB I/F mode]
                 0000:0493h [Dual-use BIOS - 1MB I/F mode]
                 INT 1Bh - Function 0Eh (FD)